package com.iraeta.service.xiangmu.impl;

import com.iraeta.dao.xiangmu.XiangmuDao;
import com.iraeta.entity.resulttype.XiangmuRt;
import com.iraeta.entity.xiangmu.Xiangmu;
import com.iraeta.service.xiangmu.XiangMuService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class XiangMuServiceImpl implements XiangMuService {
    @Autowired
    XiangmuDao xiangmuDao;

    @Override
    public void addXiangmu(Xiangmu xiangmu) {
        xiangmuDao.insert(xiangmu);
    }
    @Override
    public void updateXiangmu(Xiangmu xiangmu) {
        xiangmuDao.updateByPrimaryKey(xiangmu);
    }
    @Override
    public void deleteXiangmu(int id) {
        xiangmuDao.deleteByPrimaryKey(id);
    }

    @Override
    public Xiangmu getXiangmu(int id) {
        return xiangmuDao.selectByPrimaryKey(id);
    }

    @Override
    public List<XiangmuRt> listAll() {
        return xiangmuDao.selectAll();
    }
}
